Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LeafContext.application Casting Failure #235

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

grantjbutler
Copy link
Contributor

@grantjbutler grantjbutler commented Oct 28, 2024

These changes are now available in 4.4.1

Fixes an issue where the wrong type would be set to the application userInfo key when accessing the renderer directly on the Application (it would set a value of Application.Leaf, rather than Application, and then the casting would fail on LeafContext.application).

@@ -21,7 +21,7 @@ extension Application {

public var renderer: LeafRenderer {
var userInfo = self.userInfo
userInfo["application"] = self
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the crux of the issue. self here is of type Application.Leaf, but we want to assign an instance of Application for this key.

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.82%. Comparing base (e7c3157) to head (b7076d5).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
+ Coverage   68.44%   68.82%   +0.38%     
==========================================
  Files           5        5              
  Lines         263      263              
==========================================
+ Hits          180      181       +1     
+ Misses         83       82       -1     
Files with missing lines Coverage Δ
Sources/Leaf/Application+Leaf.swift 100.00% <100.00%> (+3.33%) ⬆️

... and 1 file with indirect coverage changes

grantjbutler added a commit to supersonicbyte/swift-vite that referenced this pull request Oct 28, 2024
@0xTim 0xTim added the semver-patch Internal changes only label Nov 3, 2024
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@0xTim 0xTim merged commit bf48d24 into vapor:main Nov 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants